Intersoft WebInput Documentation
How-to: Set initial value
Send Feedback
Intersoft WebInput > Getting Started > Samples and Walkthrough > WebInput Walkthroughs > How-to: Set initial value

Glossary Item Box

You can set initial value for WebInput from code behind.

In this topic, you will learn how to set different initial value WebInput.

To set simple input initial value

  1. Drag WebInput instance to WebForm.
  2. In Page_Load event handler function, put the following code:
  3. C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
            if (!IsPostBack)
            {
                    wiSimpleInput.Value="simple alphanumeric text for webinput 1234567890";
            }
    }
    

To set DateTimeFree input initial value

  1. Drag WebInput instance to WebForm.
  2. In Page_Load event handler function, put the following code:
  3. C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
            if (!IsPostBack)
            {
                    wiDateTimeFreeInput.Value = new DateTime(2007, 1, 1);
            }
    }
    

To set DateTimeMasked input initial value

  1. Drag WebInput instance to WebForm.
  2. In Page_Load event handler function, put the following code:
  3. C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
            if (!IsPostBack)
            {
                    wiDateTimeMaskedInput.Value = new DateTime(2007, 1, 31);
    } }

To set Number input initial value

  1. Drag WebInput instance to WebForm.
  2. In Page_Load event handler function, put the following code:
  3. C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
            if (!IsPostBack)
            {
                    wiNumberInput.Value = 12345;
            }
    }
    

To set DynamicCurrency input initial value

  1. Drag WebInput instance to WebForm.
  2. In Page_Load event handler function, put the following code:
  3. C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
            if (!IsPostBack)
            {
                    decimal currencyValue = 1000000000000000000000m;
                    wiDynamicCurrencyInput.Value = currencyValue;
            }
    }